/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ads.tree;

/**
 * 
 * @author framet-lap
 */

//inOrder
public class IsSearchTree implements Visitor<Object, Object> {

    private int last;
    private boolean inOrder = true;
    private boolean started = false;
    @Override
    public void visit(Object key, Object value) {
        if(started){
            if (inOrder) {
                inOrder=last<Integer.valueOf((String)value);
                System.out.println("Ist ein Suchbaum");
            }else{
                System.out.println("Ist kein Suchbaum");
            }
        }else{
            last = Integer.valueOf((String)value);
            started = true;
        }
    }
}
